package com.aba.dormitory.system.student;
import java.sql.Connection;
public class Main {
	public static void main(String[] args) {
        // 1. 注册学生
        boolean registered = StudentManager.registerStudent(
            "2025001", 
            "T1001", 
            "password123", 
            "张三", 
            20, 
            "男", 
            "你最喜欢的颜色是什么?", 
            "蓝色"
        );
        
        if (registered) {
            System.out.println("学生注册成功");
        } else {
            System.out.println("学生注册失败");
            return;
        }
        
        // 2. 学生登录
        Student student = StudentManager.login("2025001", "password123");
        if (student == null) {
            System.out.println("登录失败");
            return;
        }
        System.out.println("登录成功，欢迎 " + student.getName());
        
        // 3. 完善电子档案
        EmergencyContact contact = new EmergencyContact(
            "张四", 
            "父亲", 
            "13800138000", 
            "北京市海淀区"
        );
        StudentManager.completeProfile("2025001", contact);
        System.out.println("电子档案已完善");
        
        // 4. 设置寝室成绩（模拟管理员操作）
        StudentManager.setDormitoryScore("2025001", "2024-2025-1", 90.5);
        StudentManager.setDormitoryScore("2025001", "2024-2025-2", 88.0);
        
        // 5. 学生查看寝室成绩
        System.out.println("寝室成绩: " + student.viewDormitoryScores());
        
        // 6. 尝试查看其他学生信息（应该失败）
        Student anotherStudent = StudentManager.getStudent("2025002", "2025001", false);
        if (anotherStudent == null) {
            System.out.println("无法查看其他学生信息");
        }
        
        // 7. 密码找回
        boolean passwordReset = StudentManager.resetPassword(
            "2025001", 
            "蓝色", 
            "newPassword123"
        );
        if (passwordReset) {
            System.out.println("密码重置成功");
        }
    }
}    

